﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true"
    CodeFile="cart.aspx.cs" Inherits="cart" %>

<%@ Register TagName="yahoo" TagPrefix="yahoo" Src="yahool.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%--<script src="/js/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            alert(0);
            $.get('/ajax/DatHang.aspx', function (data) {
                alert(1);
                $('#DIV_DatHang').html(data);
            });
        });
    </script>--%>
    <style type="text/css">
        .dropcontent
        {
            width: 350px;
            height: auto;
            padding-top: 0px;
            padding-bottom: 0px;
            padding-left: 0px;
            padding-right: 0px;
            display: block;
        }
    </style>
    <style type="text/css">
        .dropcontent
        {
            display: none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td height="40" style="padding-left: 5px;">
                    <table border="0" align="center" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td>
                                    <strong>Hỗ trợ trực tuyến:&nbsp;&nbsp;</strong>
                                </td>
                                <td>
                                    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                                        <tbody>
                                            <yahoo:yahoo runat="server" />
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <img src="images/space.gif" width="1" height="10">
                </td>
            </tr>
        </tbody>
    </table>
    <input type="hidden" name="kind" value="">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td class="bgtitle">
                    <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                        <tbody>
                            <tr>
                                <td width="20">
                                    <img src="./images/mui_ten.gif">
                                </td>
                                <td valign="bottom" class="title">
                                    Giỏ hàng
                                </td>
                                <td width="10" valign="bottom">
                                    &nbsp;
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <img src="images/space.gif" width="1" height="10">
                </td>
            </tr>
        </tbody>
    </table>
    <br>
    <asp:GridView ID="grdData" runat="server" AutoGenerateColumns="False" CellPadding="4"
        BorderColor="#DEDFDE" Width="100%" Height="88px" BorderWidth="1px" AllowPaging="True"
        BorderStyle="None" BackColor="White" OnRowCommand="cmdOption_Click" ForeColor="Black"
        GridLines="Vertical">
        <FooterStyle BackColor="#CCCC99" />
        <RowStyle BackColor="#F7F7DE" />
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:TemplateField HeaderText="idpr" Visible="false">
                <EditItemTemplate>
                    <asp:TextBox runat="server" ID="txtidpr" Text='<% #Bind("idpr") %>'>
                    </asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblidpr" runat="server" Text='<% #Bind("idpr") %>'>
                    </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Name" HeaderText="Tên Hàng" SortExpression="namep" />
            <asp:TemplateField HeaderText="Số Lượng" SortExpression="SoLuong">
                <EditItemTemplate>
                    <asp:TextBox ID="t1" runat="server" Text='<% #Bind("total") %>' Width="30px">
                    </asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:TextBox ID="txtSoLuong" runat="server" Text='<% #Bind("total") %>' Width="30px">
                    </asp:TextBox>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Wrap="False" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Gi&#225; Tiền" SortExpression="SoLuong">
                <ItemTemplate>
                    <asp:Label ID="l3" runat="server" Text='<%#String.Format("{0:N0}",Convert.ToDouble(Eval("price"))) %>'
                        Width="100px">
                    </asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Wrap="False" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Th&#224;nh Tiền" SortExpression="SoLuong">
                <ItemTemplate>
                    <asp:Label ID="l1" runat="server" Text='<% #String.Format("{0:N0}",Convert.ToDouble(Eval("summoney"))) %>'
                        Width="120px">
                    </asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" Wrap="False" />
            </asp:TemplateField>
            <asp:ButtonField CommandName="CapNhat" Text="Sửa" ControlStyle-ForeColor="Blue">
                <ControlStyle ForeColor="Blue"></ControlStyle>
            </asp:ButtonField>
            <asp:ButtonField CommandName="Xoa" Text="Xo&#225;"></asp:ButtonField>
        </Columns>
        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#FBFBF2" />
        <SortedAscendingHeaderStyle BackColor="#848384" />
        <SortedDescendingCellStyle BackColor="#EAEAD3" />
        <SortedDescendingHeaderStyle BackColor="#575357" />
    </asp:GridView>
    <br>
    <div style="text-align: right">
        Tổng tiền:
        <asp:Label ID="LB_Sum" runat="server" Text="0"></asp:Label></div>
    <table align="center" cellpadding="2" cellspacing="0">
        <tbody>
            <tr>
                <td>
                    <a href="default.aspx">
                        <img src="images/btn_continue.gif" border="0" style="cursor: pointer"></a>
                </td>
                <td>
                    <asp:LinkButton runat="server" OnClick="Unnamed2_Click"><img src="images/btn_emty.gif" border="0" style="cursor: pointer"></asp:LinkButton>
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </tbody>
    </table>
    <br />
    <%--<div id="DIV_DatHang"></div>--%>
    <% if (Session["user"] != null)
       { %>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tbody>
            <tr>
                <td>
                    <input type="hidden" name="kind" value="1">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td style="text-align: center">
                                    <asp:Label runat="server" ID="lblthongbao" Font-Bold="True" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td width="49%" valign="top">
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tbody>
                                            <tr>
                                                <td width="49%" height="30" background="images/bgtop.jpg" bgcolor="#DDDDDD" class="bgmenupro"
                                                    style="padding-left: 10px; border-top: 1px #CCCCCC solid; border-left: 1px #CCCCCC solid;
                                                    border-right: 1px #CCCCCC solid;">
                                                    <strong>Thông tin đặt hàng đặt hàng</strong>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td valign="top" style="border: 1px #CCCCCC solid; padding: 10px; height: 210px;">
                                                    <table width="100%" border="0" cellpadding="3" cellspacing="0" bordercolor="#CCCCCC"
                                                        style="font-family: Tahoma; font-size: 10pt; border-collapse: collapse; padding: 10px">
                                                        <tbody>
                                                            <tr>
                                                                <td width="30%">
                                                                    Tên đầy đủ (*)
                                                                </td>
                                                                <td width="70%">
                                                                    <asp:TextBox runat="server" ID="txthoten" CssClass="box_input"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr bgcolor="">
                                                                <td>
                                                                    Điện thoại (*)
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox runat="server" ID="txtdienthoai" CssClass="box_input"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                    Địa chỉ email
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox runat="server" ID="txtemail" CssClass="box_input"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr bgcolor="">
                                                                <td>
                                                                    Địa chỉ (*)
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox runat="server" ID="txtdiachi" CssClass="box_input"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td valign="top">
                                                                    Yêu cầu khác
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox runat="server" ID="txtnoidung" CssClass="box_input" TextMode="MultiLine"
                                                                        Rows="10"></asp:TextBox>
                                                                </td>
                                                            </tr>
                                                            <tr>
                                                                <td>
                                                                </td>
                                                                <td>
                                                                    <asp:Button ID="Button1" runat="server" Text="Đặt hàng" Width="120" Height="25" OnClick="Unnamed3_Click1" />
                                                                </td>
                                                            </tr>
                                                            <%--<tr>
                                                                <td colspan="2" style="text-align: center">
                                                                    <asp:Label runat="server" ID="lblthongbao" Font-Bold="True" ForeColor="Red"></asp:Label>
                                                                </td>
                                                            </tr>--%>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <script language="javascript" type="text/javascript" src="../js/switchcontent.js"></script>
                    <p id="joecontent1" class="switchgroup2" style="display: none;">
                    </p>
                    <table border="0" align="center" cellpadding="0" cellspacing="0">
                        <tbody>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <% }
       else
       { %>
    <div style="color: red; text-align: center; width: 100%">
        Bạn hãy đăng nhập để đặt hàng</div>
    <% } %>
</asp:Content>
